package io.github.talelin.latticy.model;

import io.github.talelin.latticy.dto.warearea.UpdateWareareaDTO;
import io.github.talelin.latticy.dto.warearea.WareareaDTO;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

/**
 * 仓库分区
 *
 * @author generator@wulongbo
 * @since 2022-06-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("warearea")
@NoArgsConstructor
@AllArgsConstructor
public class WareareaDO extends BaseModel {

    /**
     * 仓库id
     */
    private String code;

    /**
     * 区域名称
     */
    private String name;

    /**
     * 区域优先级
     */
    private Integer areaOrder;

    /**
     * 接收
     */
    private Boolean receiveFlag;

    /**
     * 仓储
     */
    private Boolean stockFlag;

    /**
     * 拣货
     */
    private Boolean pickFlag;

    /**
     * 退货
     */
    private Boolean returnFlag;

    /**
     * 0:不可用;1:可用
     */
    private Boolean status;

    public WareareaDO(WareareaDTO dto) {
        BeanUtils.copyProperties(dto, this);
    }

    public WareareaDO(int id, UpdateWareareaDTO dto) {
        BeanUtils.copyProperties(dto, this);
        this.setId(id);
    }
}
